<html>
<head>
<title>Clock</title>
<link rel="stylesheet" type="text/css" href="../../help.css">
</head>

<body bgcolor="FFFFFF">

<h1><img  align="center" src="../../../icons/clock.gif" width="32" height="32">
<em>Clock</em></h1>

<p><table>
<tr><td><strong>Library:</strong></td>
	<td><a href="index.html">Wiring</a></td></tr>
<tr><td><strong>Introduced:</strong></td>
	<td>2.0 Beta 13 (in Base library, moved to Wiring in 2.7.0)</td></tr>
<tr><td valign="top"><strong>Appearance:</strong></td>
	<td valign="top"><img src="../../../img-libs/clock.png" width="23" height="23"></td></tr>
</table></p>

<h2>Behavior</h2>

<p>The clock toggles its output value on a regular schedule as long as
auto-ticks are enabled via the
<a href="../../guide/menu/simulate.html">Simulate menu</a>, or when a manual
half-tick or full-tick is selected from the same menu.
(Auto-ticking are disabled by default.)
A "tick" is Logisim's unit of time; the speed at which ticks occur can
be selected from the Simulate menu's Auto-Tick Frequency submenu.</p>
Each clock component's duty cycle can be independently configured using its High
Duration and Low Duration attributes.</p>

<p>Note that Logisim's simulation of clocks is quite unrealistic: In
real circuits, multiple clocks will drift from one another and will
never move in lockstep. But in Logisim, all clocks experience ticks at
the same rate.</p>

<blockquote class="warning">Warning: The auto-tick frequency is best-effort&mdash;Logisim will
    attempt to toggle the clocks at the selected frequency, but does not provide
    any guarantees. Complex circuits will necessarily require more actual time
    to simulate, and will not be able to keep up with high clock frequencies.
    The actual simulated frequency can be displayed (see the 'Window' tab of the
    Logisim Preferences).</blockquote>

<h2>Pins</h2>

<p>A clock has only one pin, an output with a bit width of 1, whose
value will represent the current value of the clock. The location of
this pin is specified in the Facing attribute. The clock's value
will toggle on its schedule whenever ticks are enabled, and it will
toggle whenever it is clicked using the <a href="poke.html">Poke
Tool</a>.</p>

<h2>Attributes</h2>

<p>When the component is selected or being added,
the arrow keys alter its <q>Facing</q> attribute.</p>

<dl>

<dt>Facing</dt>
<dd>The side of the component where its output pin should be.</dd>

<dt>High Duration</dt>
<dd>The length of time within each cycle that the clock's output should
be 1.</dd>

<dt>Low Duration</dt>
<dd>The length of time within each cycle that the clock's output should
be 0.</dd>

<dt>Label</dt>
<dd>The text within the label associated with the clock component.</dd>

<dt>Label Location</dt>
<dd>The location of the label relative to the component.</dd>

<dt>Label Font</dt>
<dd>The font with which to render the label.</dd>

</dl>

<h2>Poke Tool Behavior</h2>

<p>Clicking a clock component will toggle its current output value
immediately. Note that <b>all clocks</b> are tied to the same simulated notion
of time, so poking any one clock will toggle all clocks in the current
simulation.</p>

<h2>FPGA Synthesis</h2><p>Supports VHDL and Verilog synthesis.

<p><a href="../index.html">Up to <em>Library Reference</em></a></p>

</body>
</html>
